package com.worldtolearn.logging;

import javax.xml.parsers.FactoryConfigurationError;

import org.apache.log4j.Logger;
import org.apache.log4j.xml.DOMConfigurator;

public class SingletonLogger {

	public final static Logger monLogger = Logger.getLogger(SingletonLogger.class);
	
	private SingletonLogger() {
		try {
			DOMConfigurator.configure("log4j.properties");
			// TODO A MODIFIER SI BESOIN
//			DOMConfigurator.configure("log4j.xml");
		} catch (FactoryConfigurationError e) {
			e.printStackTrace();
		}
	}

	private final static class SingletonHolder {
		private final static SingletonLogger singletonHolder = new SingletonLogger();
	}
	
	public static SingletonLogger getInstance() {
		return SingletonHolder.singletonHolder;
	}
}
